<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--具名插槽slot-->
<!---->
<div id="app">
  <cpn>
    <span slot="center">标题</span>
  </cpn>
</div>
<template id="cpn">
  <div>
    <p>我是子组件</p>
    <slot name="left"><span>我是左面</span></slot>
    <slot name="center"><span>我是中间</span></slot>
    <slot name="right"><span>我是右面</span></slot>
    <slot><spn>没有名字</spn></slot>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  const cpn = {
    template: '#cpn',
    data() {
      return {
        name: '哈哈哈'
      }
    },
    methods: {
      showMessage() {
       console.log('我是子组件')
      }
    },
    props: {}
  }
  const app = new Vue({
    el: '#app',
    data: {
      message: "你好",
    },
    components: {
      cpn
    },
    methods: {
      btnClick () {

      }
    }
  })
</script>
</body>
</html>
